/*
 * define.h
 *
 *  Created on: 2011-10-29
 *      Author: poseidon
 */

#ifndef DEFINE_H_
#define DEFINE_H_

#include "types.h"

struct _control_data_header {
	uint16		len;			/*数据包的长度*/
	uint8		encrpyt;		/*报文的加密方式*/
	uint8		mo;				/*定义用户状态*/
	uint8		ttl;			/*定义报文生存周期*/
	uint8		extent;		/*用于以后的扩展*/
	uint16		ki;				/*定义控制命令*/
};

typedef struct _control_data_header	ctl_hdr;

struct replay_packet {
	ctl_hdr head;
	char data;
};

//加密类型
#define ENCRPYT_NO	0
#define ENCRPYT_MD5	1
#define ENCRPYT_AES	2

//用户状态
#define MO_SERVER		0
#define MO_CLIENT		1
#define MO_BROADCAST	2
#define MO_SET		3
#define MO_GET		4
#define MO_REPLAY		5

//控制类型
#define KI_IP_SET			100
#define KI_REGISTER		101
#define KI_LOGIN			102
#define KI_LOGOFF			103
#define KI_LOGCAT			104
#define KI_UPLOAD			105
#define KI_DOWNLOAD		106
#define KI_RESET			107
#define KI_SHUTDOWN		108
#define KI_LIST_FILE		109
#define KI_DEL_FILE		110
#define KI_SECURE			111
#define KI_LIGHT			112
#define KI_DEVICE			113
#define KI_BACK_MUSIC	114
#define KI_VIDEO_SHARE	115
#define KI_TIME_SERVICE	116
#define KI_REPLAY			117
#define KI_NOTIFICATION	118



//回复报文信息
#define RPL_OK							0X01
#define RPL_CANCEL					0x02
#define RPL_REGISTER_SUCCESS	0x03
#define RPL_REGISTER_FALLED		0x04
#define RPL_AUTH_PASSED			0x05
#define RPL_AUTH_FALLED			0x06
#define RPL_LOGOFF					0x07



#endif /* DEFINE_H_ */





















